<?php

namespace app\library\model;

use app\library\facade\Config;
use Medoo\Medoo;
use function PHPUnit\Framework\exactly;

class Db
{
    private static $instance = null;
    private function __construct()
    {
        self::$instance = new Medoo([
            'database_type' => 'mysql',
            'database_name' => Config::get("mysql.database_name"),
            'server' => Config::get("mysql.host"),
            'username' => Config::get("mysql.username"),
            'password' => Config::get("mysql.password"),
            'port' => Config::get("mysql.port")
        ]);
    }

    public static function getInstance(){
        if (null == self::$instance) {
            new static();
        }
        return self::$instance;
    }

    private function __clone()
    {
        // TODO: Implement __clone() method.
    }
}